package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Getter
@Setter
public class Wish extends  BaseDomain{

    private User user;

    private Strategy strategy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date creatTime;


    public Map getJson(){
        Map<String, Object> map = new HashMap<>();
        if (strategy != null) {
            map.put("strategyId",strategy.getId());
        }
        return  map;
    }

}